this.BX=this.BX||{};(function(t,e,n,i,o){"use strict";var a;var l=function(t){babelHelpers.inherits(e,t);function e(){var t;var n=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,e);t=babelHelpers.possibleConstructorReturn(this,babelHelpers.getPrototypeOf(e).call(this));t.html=i.Type.isDomNode(n===null||n===void 0?void 0:n.html)?n.html:null;t.awaitContent=i.Type.isBoolean(n===null||n===void 0?void 0:n.awaitContent)?n===null||n===void 0?void 0:n.awaitContent:null;t.flex=i.Type.isNumber(n===null||n===void 0?void 0:n.flex)?n.flex:null;t.withoutBackground=i.Type.isBoolean(n===null||n===void 0?void 0:n.withoutBackground)?n.withoutBackground:null;t.layout={container:null};if(t.awaitContent){t.await()}return t}babelHelpers.createClass(e,[{key:"getLoader",value:function t(){if(!this.loader){this.loader=new n.Loader({target:this.getContainer(),size:45})}return this.loader}},{key:"await",value:function t(){this.getContainer().classList.add("--awaiting");this.showLoader()}},{key:"stopAwait",value:function t(){this.getContainer().classList.remove("--awaiting");this.hideLoader()}},{key:"showLoader",value:function t(){void this.getLoader().show()}},{key:"hideLoader",value:function t(){void this.getLoader().hide()}},{key:"getContent",value:function t(){if(this.html){return this.html}return""}},{key:"updateContent",value:function t(e){if(i.Type.isDomNode(e)){i.Dom.clean(this.getContainer());this.getContainer().appendChild(e)}}},{key:"getContainer",value:function t(){if(!this.layout.container){this.layout.container=i.Tag.render(a||(a=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-qr-popupcomponentmader__content--section-item">',"</div>\n\t\t\t"])),this.getContent());if(this.withoutBackground){this.layout.container.classList.add("--transparent")}if(this.flex){this.layout.container.style.flex=this.flex}}return this.layout.container}}]);return e}(e.EventEmitter);var r,s;var u=function(){function t(){var e=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};babelHelpers.classCallCheck(this,t);this.target=i.Type.isElementNode(e.target)?e.target:null;this.content=e.content||null;this.contentWrapper=null;this.popup=null;this.loader=null}babelHelpers.createClass(t,[{key:"getItem",value:function t(e){if(e instanceof l){return e}return new l(e)}},{key:"addItem",value:function t(e,n){if(!(e instanceof l)){e=this.getItem(e)}if(i.Type.isDomNode(n)){n.appendChild(e.getContainer())}}},{key:"getPopup",value:function t(){if(!this.popup){var e=350;this.popup=new o.Popup(null,this.target,{className:"ui-qr-popupcomponentmader",background:"rgba(255,255,255,.88)",contentBackground:"transparent",angle:{offset:e/2-16},maxWidth:e,offsetLeft:-(e/2)+this.target.offsetWidth/2+40,autoHide:true,closeByEsc:true,padding:13,animation:"fading-slide",content:this.getContentWrapper()});this.popup.getContentContainer().style.overflowX=null}return this.popup}},{key:"isShown",value:function t(){return this.getPopup().isShown()}},{key:"getContentWrapper",value:function t(){var e=this;if(!this.contentWrapper){this.contentWrapper=i.Tag.render(r||(r=babelHelpers.taggedTemplateLiteral(['\n\t\t\t\t<div class="ui-qr-popupcomponentmader__content"></div>\n\t\t\t'])));if(!this.content){return}this.content.map(function(t){var n;var o=e.getSection();if(t!==null&&t!==void 0&&t.marginBottom){i.Type.isNumber(t.marginBottom)?o.style.marginBottom=t.marginBottom+"px":o.style.marginBottom=t.marginBottom}if(i.Type.isDomNode(t===null||t===void 0?void 0:t.html)){o.appendChild(e.getItem(t).getContainer());e.contentWrapper.appendChild(o)}if(i.Type.isArray(t===null||t===void 0?void 0:t.html)){t.html.map(function(t){var n;t!==null&&t!==void 0&&(n=t.html)!==null&&n!==void 0&&n.then?e.adjustPromise(t,o):o.appendChild(e.getItem(t).getContainer())});e.contentWrapper.appendChild(o)}if(i.Type.isFunction(t===null||t===void 0?void 0:(n=t.html)===null||n===void 0?void 0:n.then)){e.adjustPromise(t,o);e.contentWrapper.appendChild(o)}})}return this.contentWrapper}},{key:"adjustPromise",value:function t(e,n){e.awaitContent=true;var o=this.getItem(e);if(n){var a;n.appendChild(o.getContainer());e===null||e===void 0?void 0:(a=e.html)===null||a===void 0?void 0:a.then(function(t){if(i.Type.isDomNode(t)){o.stopAwait();o.updateContent(t)}})}}},{key:"getSection",value:function t(){return i.Tag.render(s||(s=babelHelpers.taggedTemplateLiteral(['\n\t\t\t<div class="ui-qr-popupcomponentmader__content--section"></div>\n\t\t'])))}},{key:"show",value:function t(){if(!i.Type.isDomNode(this.target)){return}this.getPopup().show()}},{key:"close",value:function t(){this.getPopup().close()}}]);return t}();t.PopupComponentsMader=u})(this.BX.UI=this.BX.UI||{},BX.Event,BX,BX,BX.Main);
//# sourceMappingURL=popupcomponentsmader.bundle.map.js